<template>
<div class="layerRtb layerRtb-threecolumn">
    <three-title :title="{name:'咨询'}"></three-title>
    <div class="layerRtb-scroll thinScroll" v-scrollHeight = "84">
    <div class="analyItem">
        <p class="analyItemTit tx-center">基础</p>
        <div class="analyItemCon">
            <p class="col-md-4">
                <span class="cLightGray pr8">姓名</span>
                <span name="userInfo_name">{{userInfo.u_name ? userInfo.u_name: ''}}</span>
            </p>
            <p class="col-md-4">
                <span class="cLightGray pr8">电话</span>
                <span name="userInfo_phone">{{userInfo.phone ? userInfo.phone: ''}}</span>
            </p>
            <p class="col-md-4">
                <span class="cLightGray pr8">微信</span>
                <span name="userInfo_weixin">{{userInfo.weixin ?userInfo.weixin: ''}}</span>
            </p>
            <p class="col-md-4">
                <span class="cLightGray pr8">性别</span>
                <span name="userInfo_sex">{{userInfo.sex ? userInfo.sex : ''}}</span>
            </p>
            <p class="col-md-4">
                <span class="cLightGray pr8">推荐人</span>
                <span name="userInfo_referrer"></span>
            </p>
        </div>
    </div>
    <div class="analyItem">
        <p class="analyItemTit tx-center">地区</p>
        <div class="analyItemCon">
            <p class="col-md-4">
                <span class="cLightGray pr8">地区</span>
                <span name="userInfo_u_shi" set_u_shengid="13" set_u_shiid="327">{{userInfo.u_sheng ? userInfo.u_sheng : ''}}</span>
            </p>
            <p class="col-md-4">
                <span class="cLightGray pr8">分司</span>
                <span name="userInfo_region_name" set_region_id="18">{{userInfo.region_name ? userInfo.region_name : ''}}</span>
            </p>
        </div>
    </div>
    <div class="analyItem">
        <p class="analyItemTit tx-center">实力</p>
        <div class="analyItemCon">
            <p class="col-md-4">
                <span class="cLightGray pr8">行业经验</span>
                <span name="userInfo_u_jyshijian">{{userInfoManage.worker_year ? userInfoManage.worker_year : ''}} 年</span>
            </p>
            <p class="col-md-4">
                <span class="cLightGray pr8">固定工人</span>
                <span name="userInfo_u_worker">{{userInfoManage.worker_number ? userInfoManage.worker_number : ''}} 人</span>
            </p>
        </div>
    </div>
    <div class="analyItem">
        <p class="analyItemTit tx-center">时间</p>
        <div class="analyItemCon">
            <p class="col-md-4">
                <span class="cLightGray pr8">录入时间</span>
                <span name="userInfo_u_create_date">{{stageInfo.createtime ? stageInfo.createtime.substring(0,10) : ''}}</span>
            </p>
            <p class="col-md-4">
                <span class="cLightGray pr8">激活时间</span>
                <span name="userInfo_u_register_date">{{this.sendTime ? this.sendTime.substring(0,10) : ''}}</span>
            </p>
        </div>
    </div>
</div>

            <div class="analyItem">
            <p class="analyItemTit tx-center">综合</p>
            <div class="analyItemCon">

            </div>
        </div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { selectPmUserInfoManager, GetRegionList, getSendMessageTime } from '../../Resources/Api'
export default {
    data () {
        return {
            userInfoQi: {},
            stageInfo: {},
            siName: '',
            sendTime: '',
            userInfoManage: {}
        }
    },
    created () {
        this.stageInfo = this.$route.query.stageInfo
        this.userInfo = this.$route.query.userInfo
        this.selectPmUserInfoManager()
        this.GetRegionList()
        this.getSendMessageTime()
    },
    computed: {
        ...mapGetters(['leftInfo'])
    },
    methods: {
        getSendMessageTime () {
            getSendMessageTime({
                uid: this.leftInfo.uid
            }).then(result => {
                if (Number(result.data.StatusCode) === 0) {
                    this.sendTime = result.data.Body.sendMessageTime
                }
            }).catch(err => {
                console.log('获取发送短信的时间失败getSendMessageTime，异常信息：' + err)
            })
        },
        // 查询所有的分司
        GetRegionList () {
            GetRegionList().then(result => {
                if (Number(result.data.StatusCode) === 0) {
                    // this.regionList =
                    result.data.Body.forEach(region => {
                        // this.leftInfo.areaId == 分司id
                        if (Number(region.regionId) === this.leftInfo.areaId) {
                            this.siName = region.regionName
                            return this.siName
                        }
                    })
                }
            }).catch(err => {
                console.log('查询所有的分司失败GetRegionList，异常信息：' + err)
            })
        },
        // 查询项目经理信息
        selectPmUserInfoManager () {
            selectPmUserInfoManager({
                uid: this.leftInfo.uid
            }).then(result => {
                if (Number(result.data.StatusCode) === 0) {
                    this.userInfoManage = result.data.Body
                }
            }).catch(err => {
                console.log('查询项目经理信息失败，selectPmUserInfoManager,异常信息：' + err)
            })
        },
        // 路由跳转路径拼接
        routerPath (path) {
            return this.$route.matched[1].path + '/' + path
        },
        // 直接进行路由跳转路径
        routerPush (path) {
            this.$router.push(this.$route.matched[1].path + '/' + path)
        }
    },
    route () {
    }
}
</script>

